"""

@name:python学习
@author:yuki
@projectname:起步

"""
def login(id):
    if id in dict:
        if password == dict.get(id).get('passwd'):
            print(" login successly! ".center(20,'*'))
        else:
            print("your password is not right,please try again!".center(60, '*'))
    else:
        print("your id is not exist,please try again!".center(60,'*'))

def inquire():
    print(f"{dict.get(user).get('money')}")

def withdrawl():
    try:
        x = float(input("please input the number which you want to get"))
        print(float(dict.get(user).get('money')))
        if x < float(dict.get(user).get('money')):
            dict[user]['money'] = dict.get(user).get('money') - int(x)
            print(f"withdrawl successful!your Balance have {dict.get(user).get('money')} now")
        elif x > float(dict.get(user).get('money')):
            print("your money is not enough,please inquire for confirming your deposit")
    except:
        print("The type you entered is not correctly,please input again")
        withdrawl()

def exit():
    print("welcome to come again!".center(60,'*'))
    sys.exit(0)

import sys
user = input("please input your name:")
password = input("please input your password:")
atm = 1000000
dict = {'root':{'passwd':'123456','money':6000}}
login(user)
while True:
    i = input("chose business which you want：\n1.inquire   2.withdrawal   3.exit\n")
    if i == "1":
        inquire()
    elif i == "2":
        withdrawl()
    elif i == "3":
        exit()
